package base.process_control;

public class Branch {
    public static void main(String[] args) {
        int num = 20;
        // if-else
        if (num > 0) {
            System.out.println("positive");
            if (num % 2 == 0) {
                System.out.println("even number");
            } else {
                System.out.println("odd number");
            }
        } else if (num == 0) {
            System.out.println("zero");
        } else {
            System.out.println("negative");
        }
        // switch-case
        int posNum = 5;
        switch (posNum) {
            case 0:
                System.out.println("zero");
                break;
            case 1:
            case 3:
            case 5:
            case 7:
            case 9:
                System.out.println("odd number < 10");
                break;
            case 2:
            case 4:
            case 6:
            case 8:
                System.out.println("even number < 10");
                break;
            default:
                System.out.println("double digit number");
                break;
        }
    }
}
